package com.flyco.modules.oms.mapper;

import java.util.List;

import com.flyco.modules.oms.entity.OmsOrder;
import com.flyco.modules.oms.entity.OmsOrderItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.flyco.modules.oms.model.OmsOrderItemExcel;
import com.flyco.modules.stm.entity.InoutItem;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @Description: 订单明细
 * @Author: flyco
 * @Date: 2019-12-10
 * @Version: V1.0
 */
@Repository
public interface OmsOrderItemMapper extends BaseMapper<OmsOrderItem> {

    public boolean deleteByMainId(String mainId);

    /**
     * 更新收货数量
     */
    int updateOrderItemReceiveQty(@Param("inoutItemList") List<InoutItem> inoutItemList);

    /**
     * 更新发货数量
     */
    int updateOrderItemSendQty(@Param("inoutItemList") List<InoutItem> inoutItemList);

    Integer getFreezeProductCount(@Param("productId") Long productId);

    List<OmsOrderItemExcel> getOrderItemList(@Param("order") OmsOrder order);

    List<OmsOrderItem> getByStoreIdAndProductId(Long storeId, Long productId);

    List<OmsOrderItem> getProductOccupation(String orderId, Long partnerId);
}
